Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

major refactor to enable consumers to use their own database + more #185

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

jpollard-cs
Copy link

@jpollard-cs jpollard-cs commented Oct 23, 2021

  • removes direct use of mongoose methods and abstracts data fetching/mutation with a repository interface which can be adapted for other consumers such as MySQL and postgres
  • adds a domain layer to encapsulate business logic and provide a common persistence agnostic interface
  • combines most guild settings data in a GuildSettingsAggregate object
  • uses unary methods to make things easier to extend without having to change library internals, this is also superior to positional arguments as it allows easy addition of new arguments without breaking for the consumer (provided these can be optional)
  • a few breaking changes (I will summarize when this is out of draft mode, but things that are most likely used internally and not by consumers)
  • since we are caching data in the commands/wokcommands instances this has been turned into a proxy for data operations and mutations in these have become await-able and now handle persistence
  • provides default mongo implementation for persistence
  • cooldowns are broken out of the larger guild settings aggregate to keep things reasonably performant (caching strategy is also different here although it doesn't necessarily have to be - see notes in domain model code)
  • dist folder removed from git
  • still todo:
    • finish wiring up repositories
    • finish wiring up cooldowns
    • generate typings automatically instead of needing to manually modify typings.d.ts file
    • test all the things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant